############################################################## 
## :	     
## :	 	   flyindiz
## TP2 :  TorrentPier.me
## :      ,   
## 
## Installation Level: 	Easy 
## Installation Time: 	1 Minutes 
##############################################################

#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE `bb_users` ADD `curpage_topic` mediumint(8) NOT NULL default '0';
ALTER TABLE `bb_users` ADD `curpage_topic_time` int(11) NOT NULL default '0';
#
#-----[  ]------------------------------------------
#
viewtopic.php
#
#-----[  ]------------------------------------------
#
// Start session
$user->session_start();
#
#-----[   ]------------------------------------------
#
//  
if ($bb_cfg['watch_topic'])
{
$user_id = $userdata['user_id'];
if ($user_id > 0)
{
    if ($user_id)
    {
        DB()->query("UPDATE ". BB_USERS ." SET curpage_topic = $topic_id, curpage_topic_time = ". TIMENOW ." WHERE user_id = $user_id");
    }

    $sql = DB()->fetch_rowset("SELECT username, user_id, user_rank, curpage_topic_time
      FROM " . BB_USERS . "
      WHERE curpage_topic = $topic_id
      AND (curpage_topic_time > ".( TIMENOW - 300 ).")");

    $looking_list = '';
    foreach ($sql as $row)
    {
        $looking_list .= profile_url($row) .', ';
    }
	
	$looking_list = substr($looking_list,0,strlen($looking_list)-2);

    $template->assign_vars(array(
      'LOOKING_LIST' => $lang['WHOIS_LOOKING'] . ':&nbsp; ' . $looking_list,
    ));
}}
//  [END]
#
#-----[  ]------------------------------------------
#
language/lang_russian/lang_main.php
#
#-----[  ]------------------------------------------
#
?>
#
#-----[   ]------------------------------------------
#
//  
$lang['WHOIS_LOOKING'] = '  ';
#
#-----[  ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[  ]------------------------------------------
#
?>
#
#-----[   ]------------------------------------------
#
//  
$lang['WHOIS_LOOKING'] = 'Now viewing this topic';
#
#-----[  ]------------------------------------------
#
viewtopic.tpl
#
#-----[  ]------------------------------------------
#
<!-- ENDIF / SPLIT_FORM -->
#
#-----[   ]------------------------------------------
#
<!-- IF $bb_cfg['watch_topic'] -->
<table class="topic" cellpadding="0" cellspacing="0"><!--/topic_main-->
<tr>
<td class="nav pad_6 {PG_ROW_CLASS}">
<p>{LOOKING_LIST}</p>
</td>
</tr>
</table>
<!-- ENDIF -->
#
#-----[  ]------------------------------------------

#
#-----[ SQL ]------------------------------------------
#



#
#-----[  ]------------------------------------------
#
admin_board.tpl
#
#-----[  ]------------------------------------------
#
	<td><input class="post" type="text" size="25" maxlength="100" name="birthday_check_day" value="{BIRTHDAY_CHECK_DAY}" />&nbsp;{L_DAYS}</td>
</tr>
#
#-----[   ]------------------------------------------
#

<tr class="row3 med">
	<td class="bold tCenter" colspan="2">{L_MODS}</td>
</tr>
<tr>
	<td><h4>{L_WATCH_TOPIC}</h4></td>
	<td>
	    <label><input type="radio" name="watch_topic" value="1" <!-- IF WATCH_TOPIC -->checked="checked"<!-- ENDIF --> />{L_ENABLED}</label>&nbsp;&nbsp;
		<label><input type="radio" name="watch_topic" value="0" <!-- IF not WATCH_TOPIC -->checked="checked"<!-- ENDIF --> />{L_DISABLED}</label>
	</td>
</tr>

#
#-----[  ]------------------------------------------
#
admin_board.php
#
#-----[  ]------------------------------------------
#
            'GENDER' => $new['gender'],
#
#-----[   ]------------------------------------------
#

		    'WATCH_TOPIC' => $new['watch_topic'],

#
#-----[  ]------------------------------------------
#
language/lang_russian/lang_main.php
#
#-----[  ]------------------------------------------
#
?>
#
#-----[   ]------------------------------------------
#
//  
$lang['MODS'] = '';
$lang['WATCH_TOPIC'] = '  ';

#
#-----[  ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[  ]------------------------------------------
#
?>
#
#-----[   ]------------------------------------------
#
//  
$lang['MODS'] = 'Modifications';
$lang['WATCH_TOPIC'] = 'Who is viewing topic';
#

# 
#-----[ /   ]------------------------------------------ 
# 
# EoM